/**
 * 
 */
package com.example.downloadmanagerdemo.download;

/**
 * @author careyjwang
 * 
 */
public class DownloadError {
	public static final int ERROR_DEFAULT = 0;
	public static final int ERROR_NETWORK = 1;
	public static final int ERROR_SDCARD_UNMOUNTED = 2;
	public static final int ERROR_SDCARD_SPACE_NOT_ENOUGH = 3;
	public static final int ERROR_READ = 4;
	public static final int ERROR_UNKNOW = 5;

	public int errorCode = ERROR_DEFAULT;
	public String errorMsg = "";
	public String packageName = "";

	@Override
	public String toString() {
		String result = "error default";
		switch (errorCode) {
			case ERROR_NETWORK: {
				result = "error network";
			}
				break;
			case ERROR_SDCARD_UNMOUNTED: {
				result = "error sdcard unmouted";
			}
				break;
			case ERROR_SDCARD_SPACE_NOT_ENOUGH: {
				result = "error sdcard space not enough";
			}
				break;
			case ERROR_READ: {
				result = "error read";
			}
				break;
			case ERROR_UNKNOW: {
				result = "error unknow";
			}
				break;
		}
		return result;
	}
}
